home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Education / PC-SiG's World of Education.iso / run / 2602 / plotspot.alg < prev    next >
Encoding:
Text File  |  1988-01-04  |  1000 b   |  40 lines

  1. { PLOTSPOT - Plots R. Wolf's Sunspot Numbers for the years 1749-1980 }
  2.  
  3. label="1. R. Wolf's Sunspot Numbers   1749 - 1980   2. Standard Deviation   3. Average ";
  4. ylabel="Number of Sunspots";
  5. xlabel="Year";
  6. step = 1;
  7. file = "SUNSPOT.DAT";
  8. spots = read &   ymin = min(spots) &   ymax = max(spots) &
  9. sigma=std.dev(spots) & avgspot = avg(spots);
  10. constant(avgspot); constant(sigma);
  11. print(sigma);
  12.  
  13. trace = line & plot(spots) &
  14. trace = x_s & plot(sigma) &
  15. trace = point  & plot(avgspot);
  16.  
  17. text = "Sunspot standard deviation per year = ";
  18. note(sigma,1800,175);
  19. text = "Average number of sunspots per year = ";
  20. note(avgspot,1800,165);
  21.  
  22. { Perform FFT on sunspot cycle }
  23.  
  24. step=(1980-1749)/1023;
  25. fft(spots-avgspot);
  26. trace = line;
  27. label = "Sunspot FFT Real Part";
  28. xlabel = "Frequency (Cycles per Year)";
  29. ylabel = "";
  30. erase;
  31. plot(fftre(t));
  32. pause;
  33. label = "Sunspot FFT Imaginary Part";
  34. erase;
  35. plot(fftim(t));
  36. pause;
  37. label = "Sunspot FFT Magnitude";
  38. erase;
  39. plot(fftmag(t));
  40.